#include <stdio.h>
int MyStrlen(const char* str)
{
	int length=0;
	while(*str++)
	{
		length++;
	}
	return length;
}
char* MyStrCopy(char* destination,char* source)
{
	char *save=destination;
	while(*destination++=*source++)
	{
		;
	}
	return save;
}
char* MyStrCat(char* destination,char* source)
{
	char *ret=destination;
	while(*destination)	
	{
		destination++;
	}
	while(*destination++=*source++)
	{
		;
	}
	return ret;
}
int main()
{
	char str1[20]="hello world";
	char str2[20]="aaaaaaaaaaaaa";
	int count=MyStrlen(str1);
	printf("str1,count:%d \n",count);
	MyStrCat(str1,str2);
	printf("MyStrCat,str1: %s\n",str1);
	printf("before copy: str1=%s ,str2=%s\n",str1,str2);
	MyStrCopy(str1,str2);
	printf("after copy: str1=%s ,str2=%s\n",str1,str2);
	return 0;
}
